/*
							Copyright (C) 2010  Alourien Team
									
						This file is part of the Alourien Engine.

   The Alourien Engine is free software: you can redistribute it and/or modify
   it under the terms of the GNU Lesser General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.

   The Alourien Engine is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public License
   along with the Alourien Engine.  If not, see <http://www.gnu.org/licenses/>.
	
*File Name: PhysicsImp.cpp
*Programmer Name:Jose Castellano
*Date of last update:10/28/2010
*
*Purpose:This Program is to provide all the physics that is required in any type
* of computation for our game.
*
*Basic Info: This file includes finding the velocity, the acceleration,
* the displacement, and more eventually. Header needed, MathClass, vector2D
* vectorMath
*
*UPDATES:
*1) Added the actual code to our Engine namespace
*   Date: 10/06/2010 Updater: Manuel Cuellar
*
*2) Added the last few equations needed to be completed along with 
*   the conservation of momentum equations.
*   Date: 10/18/2010 Updater: Jose Castellano
*
*3) Fixed the Names in order to actually have the functions work
*   and grouped the functions by their name
*   Date: 10/28/2010 Updater: Jose Castellano
*
*
*/

#include "Physics.h"
#include "MathClass.h"
#include "Vector2D.h"
#include "VectorMath.h"

namespace Alourien
{
	Physics::Physics(void)
	{
	}

	Physics::~Physics(void)
	{
	}

	float Physics::Velocity1(float displacement, float time)
	{
		if(time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return ((displacement / time) * -1);
		}
		else
		{
			return (displacement / time);
		}
	}
	float Physics::Velocity2(float accel, float time)
	{
		if(time < 0)
		{
			return ((time * accel) * -1);
		}
		else
		{
			return time * accel;
		}
	}
	float Physics::Velocity3(float mass, float kineticEnergy)
	{
		if(mass == 0)
		{
			return 0;
		}
		else
		{
			return obj.Sqrt((kineticEnergy / (mass*.5)));
		}
	}
	float Physics::Velocity4(float mass, float momentum)
	{
		if(mass == 0)
		{
			return 0;
		}
		else
		{
			return momentum / mass;
		}
	}
	float Physics::Velocity_F1(float velocity_I, float accel, float time)
	{
		if(time < 0)
		{
			return (((accel * time) + velocity_I) * -1);
		}
		else
		{
			return ((accel * time) + velocity_I);
		}
	}
	float Physics::Velocity_F2(float velocity_I, float accel, float displacement)
	{
		return obj.Sqrt(obj.Pow(velocity_I,2) + (2*accel*displacement));
	}
	float Physics::Velocity_F3(float velocity_I, float time, float displacement)
	{
		if (time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return ((displacement / (time/2)) - velocity_I)*-1;
		}
		else
		{
			return ((displacement / (time/2)) - velocity_I);
		}
	}
	Vector2D Physics::Velocity_F4(Vector2D projection, Vector2D velocity_I)
	{
		Vector2D temp;

		temp.x = (2 * projection.x + velocity_I.x);
		temp.y = (2 * projection.y + velocity_I.y);

		return temp;
	}
	float Physics::Velocity_I1(float velocity_F, float accel, float time)
	{
		if(time < 0)
		{
			return ((((accel * time)*-1) + velocity_F) * -1);
		}
		else
		{
			return (((accel * time)*-1) + velocity_F);
		}
	}
	float Physics::Velocity_I2(float velocity_F, float accel, float displacement)
	{
		return obj.Sqrt((2*accel*displacement *-1) + (obj.Pow(velocity_F,2)));
	}
	float Physics::Velocity_I3(float displacement, float time, float accel)
	{
		if (time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return ((displacement - (.5*accel*obj.Pow(time,2)))/time) * -1;
		}
		else
		{
			return ((displacement - (.5f*accel*obj.Pow(time,2)))/time);
		}
	}
	float Physics::Velocity_I4(float displacement, float time, float accel, 	\
		float displacement_I)
	{
		if (time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return ((displacement - (.5f*accel*obj.Pow(time,2)) - displacement_I)/time) * -1;
		}
		else
		{
			return ((displacement - (.5f*accel*obj.Pow(time,2)) - displacement_I)/time);
		}
	}
	float Physics::Velocity_I5(float velocity_F, float time, float displacement)
	{
		if (time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return ((displacement / (time/2)) - velocity_F)*-1;
		}
		else
		{
			return ((displacement / (time/2)) - velocity_F);
		}
	}
	float Physics::AngVelocity1(float rotDisplacement, float time)
	{
		if(time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return (rotDisplacement / time) * -1;
		}
		else
		{
			return rotDisplacement / time;
		}
	}
	float Physics::AngVelocity2(float angAccel, float time)
	{
		if(time < 0)
		{
			return angAccel * time * -1;
		}
		else
		{
			return angAccel * time;
		}
	}
	float Physics::AngVelocity3(float radius, float velocityTang)
	{
		if(radius == 0)
		{
			return 0;
		}
		else
		{
			return velocityTang / radius;
		}
	}
	float Physics::AngVelocity4(float kineticEnergyRot, float inertia)
	{
		if(inertia == 0)
		{
			return 0;
		}
		else
		{
			return obj.Sqrt(kineticEnergyRot / (inertia / 2));
		}
	}
	float Physics::AngVelocity5(float inertia, float angMomentum)
	{
		if(inertia == 0)
		{
			return 0;
		}
		else
		{
			return angMomentum / inertia;
		}
	}
	float Physics::VelocityTang1(float radius, float angVelocity)
	{
		return radius * angVelocity;
	}
	float Physics::VelocityTang2(float centripetalF, float radius)
	{
		return obj.Sqrt(centripetalF * radius);
	}
	float Physics::VelocityTwo_F(float m1, float v1_I, float m2, float v2_I, float e)
	{
		float temp = m1 + m2;
		float temp2 = m1 * v1_I + m2 * v2_I + m1 * e * v1_I - m1 * e * v2_I;
		if(temp == 0)
		{
			return 0;
		}
		else
		{
			return temp2 / temp;
		}
	}
	float Physics::VelocityOne_F(float v2_F, float e, float v1_I, float v2_I)
	{
		return v2_F - (e*(v1_I - v2_I));
	}
	
	float Physics::Displacement1(float time, float velocity)
	{
		if(time < 0)
		{
			return ((time * velocity) * -1);
		}
		else
		{
			return time * velocity;
		}

	}
	float Physics::Displacement2(float velocity_I, float velocity_F, float accel)
	{
		if(accel == 0)
		{
			return 0;
		}
		else
		{
			return ((obj.Pow(velocity_F,2) - obj.Pow(velocity_I,2))/(2*accel));
		}
	}
	float Physics::Displacement3(float velocity_I, float time, float accel)
	{
		if(time < 0)
		{
			return ((velocity_I * time) + (.5*accel*(obj.Pow(time,2)))) *-1;
		}
		else
		{
			return ((velocity_I * time) + (.5*accel*(obj.Pow(time,2))));
		}
	}
	float Physics::Displacement4(float velocity_I, float time, float accel, float displacement_I)
	{
		if(time < 0)
		{
			return ((velocity_I * time) + (.5f*accel*(obj.Pow(time,2))) + displacement_I)*-1;
		}
		else
		{
			return ((velocity_I * time) + (.5f*accel*(obj.Pow(time,2))) + displacement_I);
		}
	}
	float Physics::Displacement5(float velocity_I, float velocity_F, float time)
	{
		if(time < 0)
		{
			return ((time/2) * (velocity_I + velocity_F))*-1;
		}
		else
		{
			return ((time/2) * (velocity_I + velocity_F));
		}
	}
	float Physics::Displacement6(float work, float force)
	{
		if(force == 0)
		{
			return 0;
		}
		else
		{
			return work / force;
		}
	}
	float Physics::Displacement_I(float velocity_I, float displacement, float time, float accel)
	{
		if(time < 0)
		{
			return ((velocity_I * time*-1) + (.5f*accel*(obj.Pow(time,2))*-1) + displacement);
		}
		else
		{
			return ((velocity_I * time) + (.5f*accel*(obj.Pow(time,2))*-1) + displacement);
		}
	}
	float Physics::RotDisplacement1(float arcLenght, float radius)
	{
		if(radius == 0)
		{
			return 0;
		}
		else
		{
			return arcLenght / radius;
		}
	}
	float Physics::RotDisplacement2(float angVelocity, float time)
	{
		if(time < 0)
		{
			return angVelocity * time * -1;
		}
		else
		{
			return angVelocity * time;
		}
	}

	
	float Physics::Time1(float displacement, float velocity)
	{
		if(velocity == 0)
		{
			return 0;
		}
		else
		{
			return (displacement / velocity);
		}
	}
	float Physics::Time2(float accel, float velocity)
	{
		if(accel == 0)
		{
			return 0;
		}
		else
		{
			return (velocity / accel);
		}
	}
	float Physics::Time3(float velocity_I, float velocity_F, float accel)
	{
		float temp;
		if(accel ==0)
		{
			return 0;
		}
		else
		{
			temp = ((velocity_F - velocity_I) / accel);

			if(temp < 0)
			{
				return temp * -1;
			}

			else
			{
				return temp;
			}
		}
	}
	float Physics::Time4(float velocity_I, float displacement, float accel)
	{
		float temp = 0;

		temp = obj.QuadraticFormulaPlus((.5f*accel), velocity_I, (displacement*-1));
		if(temp < 0)
		{
			temp = obj.QuadraticFormulaMinus((.5f*accel), velocity_I, \
				(displacement*-1));
		}
		return temp;
	}
	float Physics::Time5(float velocity_I, float displacement, float accel, float displacement_I)
	{
		float temp = 0;

		temp = obj.QuadraticFormulaPlus((.5f*accel), velocity_I, \
			(displacement_I-displacement));
		if(temp < 0)
		{
			temp = obj.QuadraticFormulaMinus((.5f*accel), velocity_I, \
				(displacement_I-displacement));
		}
		return temp;
	}
	float Physics::Time6(float velocity_I, float velocity_F, float displacement)
	{
		return (2 * (displacement / (velocity_I + velocity_F)));
	}
	float Physics::Time7(float force, float impulse)
	{
		if(force == 0)
		{
			return 0;
		}
		else if(force < 0)
		{
			return (impulse / force)*-1;
		}
		else
		{
			return impulse / force;
		}
	}
	float Physics::Time8(float angVelocity, float rotDisplacement)
	{
		if(angVelocity == 0)
		{
			return 0;
		}
		else
		{
			return rotDisplacement / angVelocity;
		}
	}
	float Physics::Time9(float angAccel, float angVelocity)
	{
		if(angAccel == 0)
		{
			return 0;
		}
		else
		{
			return angVelocity / angAccel;
		}
	}
	float Physics::Time_I(float time_F, float impulse, float force)
	{
		if(force == 0)
		{
			return 0;
		}
		else
		{
			float temp = time_F - (impulse / force);
			if(temp < 0)
			{
				return temp * -1;
			}
			else
			{
				return temp;
			}

		}
	}
	float Physics::Time_F(float time_I, float impulse, float force)
	{
		if(force == 0)
		{
			return 0;
		}
		else
		{
			float temp = time_I + (impulse / force);
			if(temp < 0)
			{
				return temp * -1;
			}
			else
			{
				return temp;
			}

		}
	}

	
	float Physics::Accel1(float velocity, float time)
	{
		if(time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return ((velocity / time) * -1);
		}
		else
		{
			return (velocity / time);
		}
	}
	float Physics::Accel2(float velocity_I, float velocity_F, float time)
	{
		if(time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return (((velocity_F - velocity_I) / time) * -1);
		}
		else
		{
			return ((velocity_F - velocity_I) / time);
		}
	}
	float Physics::Accel3(float velocity_I, float velocity_F, float displacement)
	{
		if(displacement == 0)
		{
			return 0;
		}
		else
		{
			float temp = ((obj.Pow(velocity_F,2) - obj.Pow(velocity_I,2))/(2*displacement));
			return temp;
		}
	}
	float Physics::Accel4(float velocity_I, float displacement, float time)
	{
		if(time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return ((displacement - (velocity_I * time))/(.5*obj.Pow(time,2)))*-1;
		}
		else
		{
			return ((displacement - (velocity_I * time))/(.5*obj.Pow(time,2)));
		}
	}
	float Physics::Accel5(float velocity_I, float displacement, float time, float displacement_I)
	{
		if(time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return ((displacement - (velocity_I * time) - displacement_I)/
				(.5*obj.Pow(time,2)))*-1;
		}
		else
		{
			return ((displacement - (velocity_I * time) - displacement_I)/
				(.5*obj.Pow(time,2)));
		}
	}
	float Physics::Accel6(float mass, float force)
	{
		if(mass == 0)
		{
			return 0;
		}
		else
		{
			return force / mass;
		}
	}
	float Physics::AngAccel1(float angVelocity, float time)
	{
		if(time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return (angVelocity / time) * -1;
		}
		else
		{
			return angVelocity / time;
		}
	}
	float Physics::AngAccel2(float radius, float accelTang)
	{
		if(radius == 0)
		{
			return 0;
		}
		else
		{
			return accelTang / radius;
		}
	}
	float Physics::AngAccel3(float mass, float radius, float torque)
	{
		if(radius == 0)
		{
			return 0;
		}
		else if(mass == 0)
		{
			return 0;
		}
		else
		{
			return torque / (obj.Pow(radius, 2 ) * mass);
		}
	}
	float Physics::AngAccel4(float inertia, float torque)
	{
		if(inertia == 0)
		{
			return 0;
		}
		else
		{
			return torque / inertia;
		}
	}
	float Physics::AccelTang1(float radius, float angAccel)
	{
		return radius * angAccel;
	}
	float Physics::AccelTang2(float mass, float forceTang)
	{
		if(mass == 0)
		{
			return 0;
		}
		else
		{
			return forceTang / mass;
		}
	}
	float Physics::AccelTang3(float radius, float torque, float mass)
	{
		float m = mass * radius;
		if(m == 0)
		{
			return 0;
		}
		else
		{
			return torque / m;
		}
	}
	float Physics::AverageAccel(float velocity_I, float velocity_F)
	{
		return (velocity_I + velocity_F) / 2;
	}

	
	float Physics::Force1(float mass, float accel)
	{
		return mass*accel;
	}
	float Physics::Force2(float work, float displacement)
	{
		if(displacement == 0)
		{
			return 0;
		}
		else
		{
			return work / displacement;
		}
	}
	float Physics::Force3(float time, float impulse)
	{
		if(time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return (impulse / time)*-1;
		}
		else
		{
			return impulse / time;
		}
	}
	float Physics::Force4(float time_I, float time_F, float impulse)
	{
		float time = time_F - time_I;

		if(time == 0)
		{
			return 0;
		}
		else if(time < 0)
		{
			return (impulse / time)*-1;
		}
		else
		{
			return impulse / time;
		}
	}
	float Physics::ForceG(float mass)
	{
		return mass*g;
	}
	float Physics::ForceN(float mass)
	{
		return mass * g * -1;
	}
	Vector2D Physics::ForceGOnIncline(float mass, float angleInDegrees)
	{
		Vector2D tempData;

		tempData.x = mass * g * obj.Sin(angleInDegrees * toRad);
		tempData.y = mass * g * obj.Cos(angleInDegrees * toRad);

		return tempData;
	}
	Vector2D Physics::ForceNOnIncline(float mass, float angleInDegrees)
	{
		Vector2D tempData;
		
		tempData.x = obj.Cos(angleInDegrees * toRad) * 
			(mass * g * obj.Cos(angleInDegrees * toRad));
		tempData.y = obj.Sin(angleInDegrees * toRad) * 
			(mass * g * obj.Cos(angleInDegrees * toRad));

		return tempData;
	}
	float Physics::CentripetalF(float velocityTang, float radius)
	{
		if(radius == 0)
		{
			return 0;
		}
		return obj.Pow(velocityTang,2) / radius;
	}
	float Physics::ForceTang1(float mass, float accelTang)
	{
		return mass * accelTang;
	}
	float Physics::ForceTang2(float radius, float torque)
	{
		if(radius == 0)
		{
			return 0;
		}
		else
		{
			return torque / radius;
		}
	}
	
	float Physics::Mass1(float force, float accel)
	{
		if(accel == 0)
		{
			return 0;
		}
		else
		{
			return force / accel;
		}
	}
	float Physics::Mass2(float weightInLBS)
	{
		return (weightInLBS*4.4488222)/g;
	}
	float Physics::Mass3(float weightInN)
	{
		return weightInN/g;
	}
	float Physics::Mass4(float forceG)
	{
		return forceG / g;
	}	
	float Physics::Mass5(float forceN)
	{
		if(forceN < 0)
		{
			return forceN / (g * -1);
		}
		else
		{
			return forceN / (g * -1);
		}
	}
	float Physics::Mass6(float kineticEnergy, float velocity)
	{
		if(velocity == 0)
		{
			return 0;
		}
		else
		{
			return (kineticEnergy / (obj.Pow(velocity,2) * .5));
		}

	}
	float Physics::Mass7(float potentialEnergy, float height)
	{
		if(height == 0)
		{
			return 0;
		}
		else
		{
			return (potentialEnergy / (height * g));
		}
	}
	float Physics::Mass8(float momentum, float velocity)
	{
		if(velocity == 0)
		{
			return 0;
		}
		else
		{
			return momentum / velocity;
		}
	}
	float Physics::Mass9(float forceTang, float accelTang)
	{
		if(accelTang == 0)
		{
			return 0;
		}
		else
		{
			return forceTang / accelTang;
		}
	}
	float Physics::Mass10(float radius, float torque, float accelTang)
	{
		float m = radius * accelTang;
		if(m == 0)
		{
			return 0;
		}
		else
		{
			return torque / m;
		}
	}
	float Physics::Mass11(float radius, float torque, float angAccel)
	{
		if(radius == 0)
		{
			return 0;
		}
		else if(angAccel == 0)
		{
			return 0;
		}
		else
		{
			return torque / (obj.Pow(radius, 2 ) * angAccel);
		}
	}
	float Physics::Mass12(float inertia, float radius)
	{
		if(radius == 0)
		{
			return 0;
		}
		else
		{
			return inertia / (obj.Pow(radius,2));
		}
	}
	
	float Physics::WeightInLBS(float mass)
	{
		return (mass*g/4.4488222);
	}	
	float Physics::WeightInN(float mass)
	{
		return mass * g;
	}
	
	float Physics::StaticFriction(float staticCoefficient, float forceN)
	{
		return staticCoefficient * forceN;
	}
	float Physics::KineticFriction(float kineticCoefficient, float forceN)
	{
		return kineticCoefficient * forceN;
	}

	
	Vector2D Physics::Projection(Vector2D vector1, Vector2D vector2)
	{
		VectorMath v;
		Vector2D temp;
		float dotResult;
		float magnitude;

		dotResult = v.DotProduct(vector1, vector2);
		magnitude = obj.PythagoreanTheorem(vector2.x, vector2.y);
		//temp = normalizeVector(vector2,magnitude);

		temp.x = dotResult * temp.x;
		temp.y = dotResult * temp.y;

		return temp;
	}

	
	float Physics::Work1(float force, float displacement)
	{
		return force * displacement;
	}
	float Physics::Work2(float kineticEnergy_I, float kineticEnergy_F)
	{
		return kineticEnergy_F - kineticEnergy_I;
	}
	
	float Physics::KineticEnergy(float mass, float velocity)
	{
		return (.5*mass*obj.Pow(velocity,2));
	}
	float Physics::KineticEnergy_I(float work, float kineticEnergy_F)
	{
		return kineticEnergy_F - work;
	}
	float Physics::KineticEnergy_F(float work, float kineticEnergy_I)
	{
		return work + kineticEnergy_I;
	}
	float Physics::KineticEnergyRot(float inertia, float angVelocity)
	{
		return (.5 * inertia * obj.Pow(angVelocity,2));
	}
	
	float Physics::PotentialEnergy(float mass, float height)
	{
		return mass*height*g;
	}
	
	float Physics::Height(float mass, float potentialEnergy)
	{
		if(mass == 0)
		{
			return 0;
		}
		else
		{
			return (potentialEnergy / (mass * g));
		}
	}

	
	float Physics::Momentum(float mass, float velocity)
	{
		return mass * velocity;
	}
	float Physics::Momentum_I(float momentum_F, float impulse)
	{
		return momentum_F - impulse;
	}
	float Physics::Momentum_F(float momentum_I, float impulse)
	{
		return impulse + momentum_I;
	}
	float Physics::AngMomentum(float inertia, float angVelocity)
	{
		return inertia * angVelocity;
	}
	
	float Physics::Impulse1(float force, float time)
	{
		if(time <0)
		{
			return force*time*-1;
		}
		return force * time;
	}
	float Physics::Impulse2(float force, float time_I, float time_F)
	{
		float time = time_F - time_I;

		if(time < 0)
		{
			return (force * time)*-1;
		}
		else
		{
			return force * time;
		}
	}
	float Physics::Impulse3(float momentum_I, float momentum_F)
	{
		return momentum_F - momentum_I;
	}
	
	float Physics::CoeffOfRestitution(float separation, float approach)
	{
		if(approach == 0)
		{
			return 0;
		}
		else
		{
			return separation / approach;
		}
	}

	
	float Physics::ArcLenght(float rotDisplacement, float radius)
	{
		return rotDisplacement * radius;
	}
	
	float Physics::Radius1(float rotDisplacement, float arcLenght)
	{
		if(rotDisplacement == 0)
		{
			return 0;
		}
		else
		{
			return arcLenght / rotDisplacement;
		}
	}
	float Physics::Radius2(float velocityTang, float angVelocity)
	{
		if(angVelocity == 0)
		{
			return 0;
		}
		else
		{
			return velocityTang / angVelocity;
		}
	}
	float Physics::Radius3(float accelTang, float angAccel)
	{
		if(angAccel == 0)
		{
			return 0;
		}
		else
		{
			return accelTang / angAccel;
		}
	}
	float Physics::Radius4(float velocityTang, float centripetalF)
	{
		if(centripetalF == 0)
		{
			return 0;
		}
		else
		{
			return obj.Pow(velocityTang,2) / centripetalF;
		}
	}
	float Physics::Radius5(float torque, float forceTang)
	{
		if(forceTang == 0)
		{
			return 0;
		}
		else
		{
			return torque / forceTang;
		}
	}
	float Physics::Radius6(float torque, float mass, float accelTang)
	{
		float m = mass * accelTang;
		if(m == 0)
		{
			return 0;
		}
		else
		{
			return torque / m;
		}
	}
	float Physics::Radius7(float mass, float torque, float angAccel)
	{
		if(mass == 0)
		{
			return 0;
		}
		else if(angAccel == 0)
		{
			return 0;
		}
		else
		{
			return torque / (mass * angAccel);
		}
	}
	float Physics::Radius8(float mass, float inertia)
	{
		if(mass == 0)
		{
			return 0;
		}
		else
		{
			return obj.Sqrt(inertia / mass);
		}
	}

	
	float Physics::Torque1(float radius, float forceTang)
	{
		return radius * forceTang;
	}
	float Physics::Torque2(float radius, float mass, float accelTang)
	{
		return radius * mass * accelTang;
	}
	float Physics::Torque3(float mass, float radius, float angAccel)
	{
		return mass * obj.Pow(radius,2) * angAccel;
	}
	float Physics::Torque4(float inertia, float angAccel)
	{
		return inertia * angAccel;
	}

	
	float Physics::Inertia1(float torque, float angAccel)
	{
		if(angAccel == 0)
		{
			return 0;
		}
		else
		{
			return torque / angAccel;
		}
	}
	float Physics::Inertia2(float mass, float radius)
	{
		return mass * obj.Pow(radius,2);
	}
	float Physics::Inertia3(float kineticEnergyRot, float angVelocity)
	{
		if(angVelocity == 0)
		{
			return 0;
		}
		else
		{
			return kineticEnergyRot / (obj.Pow(angVelocity,2) / 2);
		}
	}
	float Physics::Inertia4(float angMomentum, float angVelocity)
	{
		if(angVelocity == 0)
		{
			return 0;
		}
		else
		{
			return angMomentum / angVelocity;
		}
	}
} //Namespace
